<?php
require_once 'Zend/Validate.php';
require_once 'application/library/helper/stringHelper.php';
require_once 'application/library/helper/configHelper.php';

/** 
 * gcStandardValidate
 * @author    Soochow University
 * @version   1.0
 * @exclude   作  成  日：2011/04/07
 */
class gcStandardValidate{
    
    /**
     * isAlnum
     * @param string $value 
     * @return 
     */
    public function isAlnum($value){
        return Zend_Validate::is($value, 'Alnum');
    }
    
    /**
     * isAlpha
     * @param string $value 
     * @return 
     */
    public function isAlpha($value){
        return Zend_Validate::is($value, 'Alpha');
    }
    
    /**
     * isBarcode
     * @param string $value 
     * @return 
     */
    public function isBarcode($value){
        return Zend_Validate::is($value, 'Barcode');
    }
    
    /**
     * isBetween
     * @param string $value 
     * @return 
     */
    public function isBetween($value){
        return Zend_Validate::is($value, 'Between');
    }
    
    /**
     * isCcnum
     * @param string $value 
     * @return 
     */
    public function isCcnum($value){
        return Zend_Validate::is($value, 'Ccnum');
    }
    
    /**
     * isDate
     * @param string $value 
     * @return 
     */
    public function isDate($value){
        Zend_Validate::setLocale(configHelper::getLocalLanguage());
        return Zend_Validate::is($value, 'Date');
    }
    
    /**
     * isEmailAddress
     * @param string $value 
     * @return 
     */
    public function isEmailAddress($value){
        return Zend_Validate::is($value, 'EmailAddress');
    }
    
    /**
     * isGreaterThan
     * @param string $value 
     * @return 
     */
    public function isGreaterThan($value){
        return Zend_Validate::is($value, 'GreaterThan');
    }
    
    /**
     * isGreaterThan
     * @param string $value 
     * @return 
     */
    public function isRegex($value){
        return Zend_Validate::is($value, 'Regex');
    }
    
    /**
     * isNotEmpty
     * @param string $value 
     * @return 
     */
    public function isNotEmpty($value){
        return Zend_Validate::is($value, 'NotEmpty');
    }
    
    /**
     * isInArray
     * @param string $value 
     * @return 
     */
    public function isInArray($value){
        return Zend_Validate::is($value, 'InArray');
    }
    
    /**
     * toDateTime
     * @param string $value 
     * @return 
     */
    public function toDateTime($value){
        return stringHelper::toDateTime($value);
    }
    
    /**
     * dateFormat
     * @param string $value 
     * @param string $formatString 
     * @return 
     */
    public function dateFormat($value, $formatString){
        return stringHelper::dateFormat($value, $formatString);
    }
    
    /**
     * toInt
     * @param string $value 
     * @return 
     */
    public function toInt($value){
        return stringHelper::toInt($value);
    }
    
    /**
     * toDecimal
     * @param string $value 
     * @return 
     */
    public function toDecimal($value){
        return stringHelper::toDecimal($value);
    }
    
    /**
     * toLower
     * @param string $value 
     * @return 
     */
    public function toLower($value){
        return stringHelper::toLower($value);
    }
    
    /**
     * toUpper
     * @param string $value 
     * @return 
     */
    public function toUpper($value){
        return stringHelper::toUpper($value);
    }
    
    /**
     * strLength
     * @param string $value 
     * @return 
     */
    public function strLength($value){
        return stringHelper::strLength($value);
    }
    
    /**
     * leftTrim
     * @param string $value 
     * @param string $charlist 
     * @return 
     */
    public function leftTrim($value, $charlist = null){
        return stringHelper::leftTrim($value, $charlist);
    }
    
    /**
     * rightTrim
     * @param string $value 
     * @param string $charlist 
     * @return 
     */
    public function rightTrim($value, $charlist = null){
        return stringHelper::rightTrim($value, $charlist);
    }
    
    /**
     * subString
     * @param string $value 
     * @param string $start 
     * @param string $count 
     * @return 
     */
    public function subString($value, $start, $count){
        return stringHelper::subString($value, $start, $count);
    }
    
    /**
     * subString
     * @param string $number 
     * @return 
     */
    public function moneyFormat($number){
        return stringHelper::moneyFormat($number);
    }
    
    /**
     * numberRound
     * @param string $number 
     * @param string $count 
     * @return 
     */
    public function numberRound($number, $count=null){
        return stringHelper::numberRound($number, $count);
    }
    
    /**
     * isNumber
     * @param string $number 
     * @return 
     */
    public function isNumber($number){
        return stringHelper::isNumber($number);
    }
    
    /**
     * hankakuCapitalNumberCheck
     * @param string $number 
     * @return 
     */
    public function hankakuCapitalNumberCheck($number){
        return stringHelper::hankakuCapitalNumberCheck($number);
    }
    
    /**
     * hankakuCapitalCheck
     * @param string $number 
     * @return 
     */
    public function hankakuCapitalCheck($number){
        return stringHelper::hankakuCapitalCheck($number);
    }
    
    /**
     * zenkakukanjiCheck
     * @param string $value
     * @return 
     */
    public function zenkakukanjiCheck($value){
        return stringHelper::zenkakukanjiCheck($value);
    }
    
    /**
     * idCheck
     * @param string $value
     * @return 
     */
    public function idCheck($value){
        return stringHelper::idCheck($value);
    }
    
    /**
     * zeroLeftAdd
     * @param string $value
     * @param string $count
     * @return 
     */
    public function zeroLeftAdd($value, $count=0){
        return stringHelper::zeroLeftAdd($value, $count);
    }
    
    /**
     * chkNull
     * @param string $value
     * @return 
     */
    public function chkNull($value){
        return stringHelper::chkNull($value);
    }
    
    /**
     * chkBlank
     * @param string $value
     * @return 
     */
    public function chkBlank($value){
        return stringHelper::chkBlank($value);
    }
    
    /**
     * chkInt
     * @param string $value
     * @return 
     */
    public function chkInt($value){
        return stringHelper::chkInt($value);
    }
    
    /**
     * chkFloat
     * @param string $value
     * @return 
     */
    public function chkFloat($value){
        return stringHelper::chkFloat($value);
    }
    
    /**
     * chkMaxBLength
     * @param string $value
     * @param string $maxLength
     * @return 
     */
    public function chkMaxBLength($value,$maxLength){
        return stringHelper::chkMaxBLength($value,$maxLength);
    }
    
    /**
     * chkMinBLength
     * @param string $value
     * @param string $minLength
     * @return 
     */
    public function chkMinBLength($value,$minLength){
        return stringHelper::chkMinBLength($value,$minLength);
    }
    
    /**
     * chkDate
     * @param string $value
     * @return 
     */
    public function chkDate($value){
        return stringHelper::chkDate($value);
    }
    
    /**
     * chkMaxLength
     * @param string $value
     * @param string $length
     * @return 
     */
    public function chkMaxLength($value, $length){
        return stringHelper::chkMaxLength($value, $length);
    }
    
    /**
     * chkMinLength
     * @param string $value
     * @param string $length
     * @return 
     */
    public function chkMinLength($value, $length){
        return stringHelper::chkMinLength($value, $length);
    }
    
    /**
     * chkSPEChar
     * @param string $value
     * @return 
     */
    public function chkSPEChar($value){
        return stringHelper::chkSPEChar($value);
    }
    
    /**
     * totrim
     * @param string $value
     * @return 
     */
    public function totrim($value){
        return stringHelper::totrim($value);
    }
    
    /**
     * cutString
     * @param string $value
     * @param string $length
     * @return 
     */
    public function cutString($value,$length){
        return stringHelper::cutString($value,$length);
    }
    
    /**
     * randString
     * @param int $count
     * @param string $diff('0'：number only、'1'：alpha and number)
     * @return 
     */
    public function randString($count,$diff){
        return stringHelper::randString($count,$diff);
    }
    
    /**
     * zeroShift
     * @param string $value
     * @return 
     */
    public function zeroShift($value){
        return stringHelper::zeroShift($value);
    }
    
    /**
     * zeroFormat
     * @param string $value
     * @param string $zeroNumber
     * @return 
     */
    public function zeroFormat($value, $zeroNumber=0){
        return stringHelper::zeroFormat($value, $zeroNumber);
    }
    
    /**
     * chkNotHankaku
     * @param string $value
     * @return 
     */
    public function chkNotHankaku($value){
        return stringHelper::chkNotHankaku($value);
    }
    
    /**
     * chkZenkaku
     * @param string $value
     * @return 
     */
    public function chkZenkaku($value){
        return stringHelper::chkZenkaku($value);
    }
    
    /**
     * trim
     * @param string $value
     * @return 
     */
    public function trim($value){
        return stringHelper::trim($value);
    }
    
    /**
     * getLength
     * @param string $value
     * @return 
     */
    public function getLength($value){
        return stringHelper::getLength($value);
    }
    
    /**
     * getBLength
     * @param string $value
     * @return 
     */
    public function getBLength($value){
        return stringHelper::getBLength($value);
    }
    
}

